package com.hnkywl.sts.service.portal;

import com.hnkywl.sts.dao.sys.YgDao;
import com.hnkywl.sts.entity.sys.Yg;
import com.hnkywl.sts.util.Md5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-3-13
 * Time: 上午11:20
 * To change this template use File | Settings | File Templates.
 */
@Service
public class LoginService {

    private YgDao ygDao;

    public Map login(String userName,String password){
        // 调用 UserDao.Login
        password= Md5.md5Encrypt16(password);
        return this.ygDao.findYgByNameAndPass(userName.trim(), password);
    }

    public Map loginYzt(String userName,String password){
        // 调用 UserDao.Login
        return this.ygDao.findYgByNameAndPass(userName.trim(), password);
    }

    @Autowired
    public void setYgDao(YgDao ygDao) {
        this.ygDao = ygDao;
    }
}
